CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutSign UpSign In
sagemathinc

Real-time collaboration for Jupyter Notebooks, Linux Terminals, LaTeX, VS Code, R IDE, and more,
all in one place.

GitHub Repository: sagemathinc/cocalc
Path: blob/master/src/packages/next/pages/software/sagemath/[name].tsx
Views: 687
1
/*
2
* This file is part of CoCalc: Copyright © 2021 Sagemath, Inc.
3
* License: MS-RSL – see LICENSE.md for details
4
*/
5
6
import { Alert, Layout } from "antd";
7
8
import { SoftwareEnvNames } from "@cocalc/util/consts/software-envs";
9
import Footer from "components/landing/footer";
10
import Head from "components/landing/head";
11
import Header from "components/landing/header";
12
import Image from "components/landing/image";
13
import SoftwareLibraries from "components/landing/software-libraries";
14
import { Paragraph, Title } from "components/misc";
15
import A from "components/misc/A";
16
import { Customize, CustomizeType } from "lib/customize";
17
import { ExecutableDescription } from "lib/landing/render-envs";
18
import { withCustomizedAndSoftwareSpec } from "lib/landing/software-specs";
19
import {
20
ComputeComponents,
21
ComputeInventory,
22
SoftwareSpec,
23
} from "lib/landing/types";
24
import sageScreenshot from "public/features/sage-worksheet.png";
25
import { STYLE_PAGE } from "..";
26
27
interface Props {
28
name: SoftwareEnvNames;
29
customize: CustomizeType;
30
spec: SoftwareSpec["sagemath"];
31
inventory: ComputeInventory["sagemath"];
32
components: ComputeComponents["sagemath"];
33
execInfo?: { [key: string]: string };
34
timestamp: string;
35
}
36
37
export default function SageMath(props: Props) {
38
const { name, customize, spec, inventory, components, execInfo, timestamp } =
39
props;
40
41
function renderBox() {
42
return (
43
<Alert
44
style={{ margin: "15px 0" }}
45
message="Learn More"
46
description={
47
<span style={{ fontSize: "10pt" }}>
48
Learn more about{" "}
49
<strong>
50
<A href="/features/sage">
51
SageMath related functionality in CoCalc
52
</A>
53
</strong>
54
.
55
</span>
56
}
57
type="info"
58
showIcon
59
/>
60
);
61
}
62
63
function renderInfo() {
64
return (
65
<>
66
<div style={{ width: "50%", float: "right", padding: "0 0 15px 15px" }}>
67
<Image src={sageScreenshot} alt="SageMath" />
68
</div>
69
<Paragraph>
70
This table lists pre-installed{" "}
71
<A href="https://www.sagemath.org">SageMath</A> packages that are
72
immediately available in every CoCalc project running on the default
73
"Ubuntu {name}" image, along with their respective version numbers.
74
</Paragraph>
75
<Paragraph type="secondary">
76
Note: Besides this default SageMath environment, there are also older
77
versions available.
78
</Paragraph>
79
</>
80
);
81
}
82
83
return (
84
<Customize value={customize}>
85
<Head title="SageMath in CoCalc" />
86
<Layout>
87
<Header page="software" subPage="sagemath" softwareEnv={name} />
88
<Layout.Content
89
style={{
90
backgroundColor: "white",
91
}}
92
>
93
<div style={STYLE_PAGE}>
94
<Title level={1} style={{ textAlign: "center" }}>
95
SageMath (Ubuntu {name})
96
</Title>
97
{renderInfo()}
98
{renderBox()}
99
<ExecutableDescription spec={spec} execInfo={execInfo} />
100
<SoftwareLibraries
101
spec={spec}
102
inventory={inventory}
103
components={components}
104
libWidthPct={60}
105
timestamp={timestamp}
106
/>
107
</div>
108
<Footer />
109
</Layout.Content>
110
</Layout>
111
</Customize>
112
);
113
}
114
115
export async function getServerSideProps(context) {
116
return await withCustomizedAndSoftwareSpec(context, "sagemath");
117
}
118
119